/*
 * CN_SKILL.cpp
 *
 *  Created on: 2013. 5. 21.
 *      Author: the2
 */


#include "../../User.h"
#include "CN_SKILL.h"

#include "../../NLogic/Space.h"

namespace ProjectZ { namespace NCommand { namespace NBattle {

void CN_SKILL::OnExecute(User * pUser, ::Network::Packet * pPacket)
{
	PREPARE_PACKET;

	int x = 0;
	int y = 0;
	int degree = 0;
	int gid = 0;
	int skill_tid = 0;
	int skill_level = 0;
	int ismonster = 0;

	pPacket->ParseMsg("%2d%2d%2d%d%2d%c%c", &x, &y, &degree, &gid, &skill_tid, &skill_level, &ismonster);

	NLogic::Space * pSpace = pUser->GetSpace();
	if (NULL == pSpace)
		return;

	::Network::Packet * pNoti = ::Network::GETPACKETPOOL()->SEND_NEW();
	pNoti->MsgCat("%2d%2d%2d%d%2d%c%c", x, y, degree, gid, skill_tid, skill_level, ismonster);
	pNoti->MakePacket(CMD_SN_SKILL);

	pSpace->SendAllExceptMe(pNoti, pUser);
}

} /*NBattle*/ } /*NCommand*/ } /*ProjectZ*/
